package com.chinasoft.book.app;

import com.chinasoft.book.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanAutowiredMain {

    public static void main(String[] args) {
        // spring ioc 自动进行了依赖注入
        ApplicationContext ioc = new ClassPathXmlApplicationContext("bean_autowire.xml");

        // bookMapper 对象是否可用
        BookService bookService = ioc.getBean("bookService", BookService.class);

        bookService.queryBook();
    }
}
